<?php
class Xzsdsplus_Costpriceplus_Model_Groups extends Mage_Core_Model_Abstract{
    public function _construct() {
        parent::_construct();
        $this->_init('costpriceplus/groups');
    }
    public function getAsOptions() {
        $options = array(''=>Mage::helper('costpriceplus')->__('Select'));
        $optionsArray = $this->getCollection()->toOptionArray();
        foreach ($optionsArray as $option) $options[$option['value']] = $option['label'];
        return $options;
    }
        
    public function getAssociatedProducts() {
        return $this->_getResource()->getAssociatedProductIds($this);
    }
}